#include <iostream> 
using namespace std;

int main(){
	
	int n,k,max,min;
	cin >> n >> k;
	if (k == 0 || k == n){
		max = 0;
		min = 0;
	}
	else if(n / 3 >= k){
		max = k * 2;
		min = 1;
	}
	else{
		max = n - k;
		min = 1;
	}
	cout << min << ' ' << max << endl;
	return 0;
}
